﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="createRole.aspx.cs" Inherits="NCC_SOP.Admin.AdministratorOnly.WebForm2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
 <style type="text/css">
        .required
        {
            color: Red;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat= "server"> <table>
        <tr>
            <td>
                <h3>
                    Create New Role</h3>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="right">
                Role Name:
            </td>
            <td>
                <asp:TextBox ID="RoleName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="right">Users in new Role:</td>
            <td>
                <asp:CheckBoxList ID="Users" runat="server"></asp:CheckBoxList>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <asp:RequiredFieldValidator ID="RequriedFieldValidator1" CssClass="required" ErrorMessage="Role Name is needed." ControlToValidate="RoleName" ValidationGroup="CreateRole" runat="server"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <asp:CustomValidator ID="CustomValidator1" CssClass="required" ErrorMessage="Role Name already exists." ControlToValidate="RoleName" ValidationGroup="CreateRole" OnServerValidate="CheckRoleExists" runat="server"></asp:CustomValidator>
            </td>
        </tr>
        <tr>
            <td colspan="3" align="right">
                <asp:Button ID="Create" Text="Create Role" runat="server" ValidationGroup="CreateRole" OnClick="CreateRole" CausesValidation="true"/>
            </td>
        </tr>
    </table></asp:View>

<asp:View ID="View2" runat= "server">
<table>
<tr>
<asp:Label Text="You have successfully created the role." runat="server"></asp:Label>
</tr>
<tr>
<asp:LinkButton Text="Click here to go back to Home Page." runat="server" OnClick="RedirectToHomePage"></asp:LinkButton>
</tr>
</table></asp:View>
</asp:MultiView>
   
</asp:Content>
